package com.dooioo.fangyou.service.impl;

import com.dooioo.fangyou.entity.Pet;
import com.dooioo.fangyou.service.PetService;
import org.springframework.stereotype.Service;

/**
 * Created by IntelliJ IDEA.
 * User: kuang
 * Date: 2010-11-30
 * Time: 22:45:26
 * To change this template use File | Settings | File Templates.
 */

@Service
public class PetServiceImpl extends SpringBaseServiceImpl<Pet> implements PetService<Pet> {

    public boolean updatePet(Pet pet) {
        Pet params = pet;
        params.setType_id(pet.getType().getId());
        return queryDao.update(updateAlias(), params) > 0;
    }

    public boolean storePet(Pet pet) {
        Pet params = pet;
        params.setType_id(pet.getType().getId());
        params.setOwner_id("1");
        return queryDao.update(insertAlias(), params) > 0;
    }

}
